home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0158_6 Common Text Modes.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  3KB  |  109 lines

  1. {
  2. This is some code I did for someone.  I figure they may be one of you all that
  3. need it.
  4. Also put it in SWAG if you like it.
  5.  
  6. This will let you change between the 6 most common text modes!  Nice easy to
  7. read code I think. <grin>
  8. There is NO warranty with this!  You are on your own if it messes anything up!
  9. ----------------> CUT HERE <--------------
  10.  
  11. (* Info:                                                                     *)
  12. (*                                                                           *)
  13. (*  Forbis's Cool Text Mode Thing v0.01                                      *)
  14. (*  by: Chris Forbis                                                         *)
  15. (*  CopyRight 1994 . All Rights Reserved                                     *)
  16. (*                                                                           *)
  17. (* About:                                                                    *)
  18. (*  I worked on this one day when well I just had to get into 132x25x16!     *)
  19. (*  Enjoy!  Please don't hack this up!  If you use  ease give me a little    *)
  20. (*  credit where it is due.                                                  *)
  21. (*                                                                           *)
  22. (* Getting Hold Of Me:                                                       *)
  23. (*                                                                           *)
  24. (* InterNet:  forbis@vsl.ist.ucf                                             *)
  25. (* FidoNet :  1:363/246                                                      *)
  26. (*            Pascal and Pascal Lessons Areas                                *)
  27. (* BBS     :  Darkened Lands (407)679-3449                                   *)
  28. }
  29.  
  30. program TEXTMODE;
  31.  
  32. procedure SetMode_80_25_16; assembler;
  33. asm
  34.   mov ax, 03h
  35.   int 10h
  36. end;
  37.  
  38. procedure SetMode_80_25_2; assembler;
  39. asm
  40.   mov ax, 07h
  41.   int 10h
  42. end;
  43.  
  44. procedure SetMode_80_60_16; assembler;
  45. asm
  46.   mov ax, 4Eh
  47.   int 10h
  48. end;
  49.  
  50. procedure SetMode_132_60_16; assembler;
  51. asm
  52.   mov ax, 4Fh
  53.   int 10h
  54. end;
  55.  
  56. procedure SetMode_132_25_16; assembler;
  57. asm
  58.   mov ax, 50h
  59.   int 10h
  60. end;
  61.  
  62. procedure SetMode_132_43_16; assembler;
  63. asm
  64.   mov ax, 51h
  65.   int 10h
  66. end;
  67.  
  68. procedure HelpMenu;
  69. begin
  70.   writeln('■ Forbis''s Cool Text Mode Thing! v0.01');
  71.   writeln('────────────────────────────────────────');
  72.   writeln('Usage: TEXTMODE <MODE>');
  73.   writeln;
  74.   writeln('MODE:');
  75.   writeln('       0 : 80x 25y 16c   Mode: 03h');
  76.   writeln('       1 : 80x 25y 2c    Mode: 07h');
  77.   writeln('       2 : 80x 60y 16c   Mode: 4Eh');
  78.   writeln('       3 : 132x 60y 16c  Mode: 4Fh');
  79.   writeln('       4 : 132x 25y 16c  Mode: 50h');
  80.   writeln('       5 : 132x 43y 16c  Mode: 51h');
  81.   writeln('────────────────────────────────────────');
  82.   writeln('I will not be held liable if this messes');
  83.   writeln('up your machine!');
  84.   writeln('────────────────────────────────────────');
  85. end;
  86.  
  87. var
  88.   st : string[1];
  89.   ch : char;
  90.  
  91. begin
  92.   if (paramcount = 0) then begin
  93.     HelpMenu;
  94.   end else begin
  95.     st := paramstr(1);
  96.     ch := st[1];
  97.     case upcase(ch) of
  98.       '0' : SetMode_80_25_16;
  99.       '1' : SetMode_80_25_2;
  100.       '2' : SetMode_80_60_16;
  101.       '3' : SetMode_132_60_16;
  102.       '4' : SetMode_132_25_16;
  103.       '5' : SetMode_132_43_16;
  104.       else HelpMenu;
  105.     end;
  106.   end;
  107.   writeln('Thanks for using Forbis''s Cool Text Mode Thing!');
  108. end.
  109.